﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcBHXH.Common;

namespace MvcBHXH.Models
{
    class CoSoKCBModel
    {

        private DataClassesBHYTTNDataContext context;
        public CoSoKCBModel() 
        {
            context = Util.CreateInstance().DataContext();
        }

        public List<CoSoKCBModel> GetCoSoKCBModel()
        {
            var CoSoKCBModel = from fc in context.tbl_CoSoKCBs
                               select new
                               {
                                   fc.Ma_CoSoKCB,
                                   fc.Ten_CoSoKCB,
                                   fc.DiaChi,
                                   fc.DienThoai,
                                   fc.GhiChu,
                               };
            List<CoSoKCBModel> listCoSoKCBModel = new List<CoSoKCBModel>();
            CoSoKCBModel coSoKCB;
            foreach (var item in CoSoKCBModel)
            {
                coSoKCB = new CoSoKCBModel();
                coSoKCB.MaCoSoKCB = item.Ma_CoSoKCB;
                coSoKCB.Ten_CoSoKCB = item.Ten_CoSoKCB;
                coSoKCB.DiaChi = item.DiaChi;
                coSoKCB.DienThoai = item.DienThoai;
                coSoKCB.GhiChu = item.GhiChu;
                listCoSoKCBModel.Add(coSoKCB);
            }
            return listCoSoKCBModel;
        }


        private string maCoSoKCB;

        public string MaCoSoKCB
        {
            get { return maCoSoKCB; }
            set { maCoSoKCB = value; }
        }
        private string ten_CoSoKCB;

        public string Ten_CoSoKCB
        {
            get { return ten_CoSoKCB; }
            set { ten_CoSoKCB = value; }
        }
        private string diaChi;

        public string DiaChi
        {
            get { return diaChi; }
            set { diaChi = value; }
        }
        private string dienThoai;

        public string DienThoai
        {
            get { return dienThoai; }
            set { dienThoai = value; }
        }
        private string ghiChu;

        public string GhiChu
        {
            get { return ghiChu; }
            set { ghiChu = value; }
        }


    }
}
